package com.zwan.oam_rtc.constants;

import java.util.Vector;


public class DbStatusType {
	private static Vector<DbStatusType> values = new Vector<DbStatusType>();
	private final int mValue;
	public final int getKey() {return mValue;}
	
	private final String mStringValue;

	public final static DbStatusType INVALIDATION = new DbStatusType(0,"失效");
	public final static DbStatusType VALIDATION = new DbStatusType(1,"有效");
	
	
	private DbStatusType(int value,String stringValue) {
		mValue = value;
		values.addElement(this);
		mStringValue=stringValue;
	}
	
	public static Vector<DbStatusType> all()
	{
		return values;
	}
	
	public static DbStatusType fromInt(int value) {

		for (int i=0; i<values.size();i++) {
			DbStatusType userType = values.elementAt(i);
			if (userType.mValue == value) return userType;
		}
		throw new RuntimeException("state not found ["+value+"]");
	}
	public String getValue() {
		return mStringValue;
	}

}
